package com.xxgc.demo.controller.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * @Author:SJY
 * @Date :2023/9/12 - 09 - 12 - 8:49
 * 实名认证VO
 */
@Schema(name = "实名认证VO",description = "实名认证VO")
@Data
public class NameAuthenticationOV {
    //@Pattern正则表达式只能给String（字符串）使用
    //int不支持@NoutNull 需要改成Integer
    @NotNull(message = "id必填")
    @Schema(description = "用户id",requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer id;

    @Size(min = 2,message = "姓名最少两位")
    @Pattern(regexp = "^[\u4e00-\u9fa5]+$", message = "姓名只能出现中文")
    @Schema(description = "姓名",requiredMode = Schema.RequiredMode.REQUIRED)
    private String name;

    @Pattern(regexp = "^\\d{17}[\\dX]$",message = "身份证号必须是有效中国身份证")
    @Schema(description = "身份证号",requiredMode = Schema.RequiredMode.REQUIRED)
    private String idCard;
}
